package com.hustbaidu.hustmap;

import android.os.Parcel;
import android.os.Parcelable;

public class PlaceInfo implements Parcelable{
	private int id;
	private String placeName;
	private String placeImg;
	private int placePositionX, placePositionY;
	private int touchLeft, touchTop, touchRight, touchBottom;
	private int placeType;
	private int placeRoad;
	private String placeIntroduce;
	
	/**
	 * 判断所给坐标是否落在自己的范围内
	 * @param x X坐标
	 * @param y Y坐标
	 * @return 如果落在自己的范围内则返回true，否则返回false
	 * */
	public boolean isBeTouched(int x, int y){
		if(x > touchLeft && x < touchRight && y > touchTop && y < touchBottom){
			return true;
		}
		
		return false;
	}
	
	@Override
	public int describeContents() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public void writeToParcel(Parcel dest, int flags) {
		// TODO Auto-generated method stub
		dest.writeInt(id);
		dest.writeString(placeName);
		dest.writeString(placeImg);
		dest.writeInt(placePositionX);
		dest.writeInt(placePositionY);
		dest.writeInt(touchLeft);
		dest.writeInt(touchTop);
		dest.writeInt(touchRight);
		dest.writeInt(touchBottom);
		dest.writeInt(placeType);
		dest.writeInt(placeRoad);
		dest.writeString(placeIntroduce);
	}

	 public static final Parcelable.Creator<PlaceInfo> CREATOR = new Parcelable.Creator<PlaceInfo>(){

		@Override
		public PlaceInfo createFromParcel(Parcel source) {
			// TODO Auto-generated method stub
			PlaceInfo place = new PlaceInfo();
			place.id = source.readInt();
			place.placeName = source.readString();
			place.placeImg = source.readString();
			place.placePositionX = source.readInt();
			place.placePositionY = source.readInt();
			place.touchLeft = source.readInt();
			place.touchTop = source.readInt();
			place.touchRight = source.readInt();
			place.touchBottom = source.readInt();
			place.placeType = source.readInt();
			place.placeRoad = source.readInt();
			place.placeIntroduce = source.readString();
			return place;
		}

		@Override
		public PlaceInfo[] newArray(int size) {
			// TODO Auto-generated method stub
			return null;
		}
		 
	 };


	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getPlaceName() {
		return placeName;
	}
	public void setPlaceName(String placeName) {
		this.placeName = placeName;
	}
	
	public String getPlaceImg() {
		return placeImg;
	}

	public void setPlaceImg(String placeImg) {
		this.placeImg = placeImg;
	}

	public int getPlacePositionX() {
		return placePositionX;
	}
	public void setPlacePositionX(int placePositionX) {
		this.placePositionX = placePositionX;
	}
	public int getPlacePositionY() {
		return placePositionY;
	}
	public void setPlacePositionY(int placePositionY) {
		this.placePositionY = placePositionY;
	}
	public int getTouchLeft() {
		return touchLeft;
	}
	public void setTouchLeft(int touchLeft) {
		this.touchLeft = touchLeft;
	}
	public int getTouchTop() {
		return touchTop;
	}
	public void setTouchTop(int touchTop) {
		this.touchTop = touchTop;
	}
	public int getTouchRight() {
		return touchRight;
	}
	public void setTouchRight(int touchRight) {
		this.touchRight = touchRight;
	}
	public int getTouchBottom() {
		return touchBottom;
	}
	public void setTouchBottom(int touchBottom) {
		this.touchBottom = touchBottom;
	}
	public int getPlaceType() {
		return placeType;
	}
	public void setPlaceType(int placeType) {
		this.placeType = placeType;
	}
	public int getPlaceRoad() {
		return placeRoad;
	}
	public void setPlaceRoad(int placeRoad) {
		this.placeRoad = placeRoad;
	}
	public String getPlaceIntroduce() {
		return placeIntroduce;
	}
	public void setPlaceIntroduce(String placeIntroduce) {
		this.placeIntroduce = placeIntroduce;
	}
	
	

}
